package org.protege.owl.examples.tab;

import java.awt.Component;
import java.io.PrintWriter;
import java.io.StringWriter;

import javax.swing.JOptionPane;

public class ErrorLogger
{	
	public static void log(Exception ex)
	{
		StringWriter sw = new StringWriter();
        PrintWriter pw = new PrintWriter(sw, true);
        ex.printStackTrace(pw);
        pw.flush();
        sw.flush();
        errorFrame.addText(sw.toString());
        errorFrame.showError();
	}
	
	public static void log(String errorStr)
	{
		errorFrame.addText(errorStr);
		errorFrame.showError();
	}
	
	private static ErrorFrame errorFrame = new ErrorFrame();
}
